import React from 'react'
import Child from './child'
import {Button} from 'antd'
// import 'antd/dist/antd.css'
import './index.less'

export default class life extends React.Component{
    constructor(props){
        super(props)
        this.state = {
            count:0
        }
    }

    handleAdd(){
        this.setState({
            count:this.state.count+1
        })
    }
    
    handleAdd2 = ()=>{
        this.setState({
            count:this.state.count+1
        })
    }


    render(){
        return <div>
            <Button>ffff</Button>
            <p className="content">react生命周期</p>
            <button onClick = {this.handleAdd.bind(this)}> 点击一下</button>
            <button onClick = {this.handleAdd2}> 点击一下</button>
            <p>{this.state.count}</p>
            <Child name={this.state.count}></Child>
        </div>
    }






}